package com.noreply.springlearning.imports;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.Map;

/**
 * @author noreply
 * @description
 * @datetime 2022/5/6 10:21
 */
public class UserServiceImportSelect implements ImportSelector {


    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
        Map<String, Object> annotationAttributes = annotationMetadata.getAnnotationAttributes(EnableUserService.class.getName(), true);
        annotationAttributes.forEach((k,v) -> {
            System.out.println(k + ",    " + v);
        });
        return new String[]{UserService.class.getName()};
    }
}
